import React from 'react'
// import { Link } from 'react-router-dom'
// import { Result, Button } from 'antd'
// import { useRecoilValue } from 'recoil'
// import { userState } from '@/store/user'
// import { adminEnum } from '@/store/adminEnumObject'
// import { userInfo } from '@/store/userInfo'
import { havePpermission } from '@/utils'

export interface IProps {
  children: React.ReactNode
  role: number | number[]
}

const Permission: React.FC<IProps> = ({ role, children }) => (havePpermission(role) ? <>{children}</> : <></>)

export default Permission
